package com.FunctionInterfaceDemo;

import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 *  消费性接口 :只有输入，没有返回
 *
 *  供给性接口 :只有返回，没有输入
 *
 * */
public class Demo3 {
    public static void main(String[] args) {
        Consumer<String> consumer = null;
        Supplier<String> supplier = null;
        consumer = (o)->{
            System.out.println(o);
        };
        supplier = ()->{
           return "ABC";
        };
        //输入
        consumer.accept("123");
        //输出
        System.out.println(supplier.get());
    }
}
